From d809ceee2ef2d86e83f274c3040d80a451d86884 Mon Sep 17 00:00:00 2001 From: Owen Taylor Date: Thu, 21 Jun 2001 17:45:26 +0000 Subject: [PATCH] Handle the case without XKB properly. Thu Jun 21 13:42:01 2001 Owen Taylor * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle the case without XKB properly. * gtk/gtkrc.c (gtk_rc_set_default_files): Remove unused gtk_rc_auto_parse variable. * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no longer needed with GdkPixbuf. * gtk/gtkrc.c (_gtk_rc_init): Make private. --- ChangeLog | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-0 | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-10 | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-2 | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-4 | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-6 | 36 +++++++++++++++++++++++++++++++++++- ChangeLog.pre-2-8 | 36 +++++++++++++++++++++++++++++++++++- docs/Changes-2.0.txt | 3 ++- gdk/x11/gdkkeys-x11.c | 18 ++++++++++++------ gtk/gtkentry.h | 3 +++ gtk/gtkmain.c | 2 +- gtk/gtkrc.c | 40 +--------------------------------------- gtk/gtkrc.h | 25 ++++++++----------------- gtk/gtkstyle.c | 21 ++++++++++++++++++--- 14 files changed, 290 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 0c97a52804..fe1fabff78 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,37 @@ +Thu Jun 21 13:42:01 2001 Owen Taylor + + * gdk/x11/gdkkeys-x11.c (gdk_keymap_get_direction): Handle + the case without XKB properly. + + * gtk/gtkrc.c (gtk_rc_set_default_files): Remove + unused gtk_rc_auto_parse variable. + + * gtk/gtkrc.[ch] gtk/gtkstyle.c docs/Changes-2.0.txt: + Remove gtk_rc_set_image_loader(), gtk_rc_load_image(), no + longer needed with GdkPixbuf. + + * gtk/gtkrc.c (_gtk_rc_init): Make private. + +Fri Jun 15 16:26:12 2001 Owen Taylor + + * gtk/gtkentry.h: Mark deprecated functions with + GTK_DISABLE_DEPRECATED. + +Mon Jun 11 18:15:16 2001 Owen Taylor + + * gdk/gdk.h: Add missing gdk_rectangle_get_type() prototype. + + * gtk/gtk[hv]scale.c: Include math.h, stdlib.h + + * gdk/gdkpango.h gtk/gtkclist.c gtk/gtkentry.c gtk/gtkmain.[ch] + gtk/gtkspinbutton.c gtk/gtkstyle.c gtk/gtktextbuffer.c + gtk/gtktextdisplay.c gtk/gtktextiter.[ch] + gtk/gtktextlayout.c gtk/gtktexttag.[ch] gtk/gtkwidget.c: Adapt + to recent changes in Pango. + + * tests/testgtk.c: Set language tags with gtk_label_set_markup() + to test whether the basic engine honors them. + Thu Jun 21 02:13:40 2001 Tim Janik * gtk/gtkcontainer.[hc]: added gtk_container_child_set_property() and @@ -136,7 +170,7 @@ Thu Jun 14 19:21:27 2001 Jonathan Blandford * demos/gtk-demo/main.c (main): fix colors ;-) -Fri Jun 8 17:56:52 2001 Owen Taylor +`Fri Jun 8 17:56:52 2001 Owen Taylor * gtk/gtkwindow.[ch] gtk/gtkmain.c: Add a GtkWindowGroup struct that allows grouping together multiple windows so that grabs diff --git a/docs/Changes-2.0.txt b/docs/Changes-2.0.txt index 69e7917615..56a8fe88ad 100644 --- a/docs/Changes-2.0.txt +++ b/docs/Changes-2.0.txt @@ -364,4 +364,5 @@ Incompatible Changes from GTK+-1.2 to GTK+-2.0: The purpose of this change was to allow non-containers to have focusable elements. - \ No newline at end of file +* gtk_rc_set_image_loader() and gtk_rc_load_image() has been removed, now + that GTK+ includes decent image loading capabilities itself. diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c index 6e18a6337e..4b353c8573 100644 --- a/gdk/x11/gdkkeys-x11.c +++ b/gdk/x11/gdkkeys-x11.c @@ -192,7 +192,6 @@ get_keymap (void) } #if HAVE_XKB - PangoDirection get_direction (void) { @@ -236,13 +235,20 @@ _gdk_keymap_state_changed (void) PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap) { - if (!have_direction) +#if HAVE_XKB + if (_gdk_use_xkb) { - current_direction = get_direction (); - have_direction = TRUE; - } + if (!have_direction) + { + current_direction = get_direction (); + have_direction = TRUE; + } - return current_direction; + return current_direction; + } + else +#endif /* HAVE_XKB */ + return PANGO_DIRECTION_LTR; } /** diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h index 746d8c9c3d..b639e13e5d 100644 --- a/gtk/gtkentry.h +++ b/gtk/gtkentry.h @@ -181,6 +181,8 @@ void gtk_entry_get_layout_offsets (GtkEntry *entry, /* Deprecated compatibility functions */ + +#ifndef GTK_DISABLE_DEPRECATED GtkWidget* gtk_entry_new_with_max_length (gint max); void gtk_entry_append_text (GtkEntry *entry, const gchar *text); @@ -191,6 +193,7 @@ void gtk_entry_set_position (GtkEntry *entry, void gtk_entry_select_region (GtkEntry *entry, gint start, gint end); +#endif /* GTK_DISABLE_DEPRECATED */ #ifdef __cplusplus } diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c index 2d45b4fc14..6807dae8f2 100644 --- a/gtk/gtkmain.c +++ b/gtk/gtkmain.c @@ -487,7 +487,7 @@ gtk_init_check (int *argc, gtk_colormap = gdk_colormap_get_system (); gtk_type_init (0); - gtk_rc_init (); + _gtk_rc_init (); /* Register an exit function to make sure we are able to cleanup. diff --git a/gtk/gtkrc.c b/gtk/gtkrc.c index 9480df31ba..4766fa56e1 100644 --- a/gtk/gtkrc.c +++ b/gtk/gtkrc.c @@ -247,7 +247,6 @@ static GSList *gtk_rc_sets_class = NULL; #define GTK_RC_MAX_DEFAULT_FILES 128 static gchar *gtk_rc_default_files[GTK_RC_MAX_DEFAULT_FILES]; -static gboolean gtk_rc_auto_parse = TRUE; #define GTK_RC_MAX_PIXMAP_PATHS 128 static gchar *pixmap_path[GTK_RC_MAX_PIXMAP_PATHS]; @@ -262,8 +261,6 @@ static GSList *rc_dir_stack = NULL; /* The files we have parsed, to reread later if necessary */ static GSList *rc_files = NULL; -static GtkImageLoader image_loader = NULL; - /* RC file handling */ @@ -492,7 +489,6 @@ gtk_rc_set_default_files (gchar **files) } gtk_rc_default_files[0] = NULL; - gtk_rc_auto_parse = FALSE; i = 0; while (files[i] != NULL) @@ -560,7 +556,7 @@ gtk_rc_get_default_files (void) } void -gtk_rc_init (void) +_gtk_rc_init (void) { static gboolean initialized = FALSE; static gchar *locale_suffixes[3]; @@ -3276,37 +3272,3 @@ gtk_rc_parse_stock (GScanner *scanner, return G_TOKEN_NONE; } - -/* -typedef GdkPixmap * (*GtkImageLoader) (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename); -*/ - -void -gtk_rc_set_image_loader(GtkImageLoader loader) -{ - image_loader = loader; -} - -GdkPixmap * -gtk_rc_load_image (GdkColormap *colormap, - GdkColor *transparent_color, - const gchar *filename) -{ - if (strcmp (filename, "") == 0) - return (GdkPixmap*) GDK_PARENT_RELATIVE; - else - { - if(image_loader) - return image_loader(NULL, colormap, NULL, - transparent_color, - filename); - else - return gdk_pixmap_colormap_create_from_xpm (NULL, colormap, NULL, - transparent_color, - filename); - } -} diff --git a/gtk/gtkrc.h b/gtk/gtkrc.h index c68a13d209..1507b177ac 100644 --- a/gtk/gtkrc.h +++ b/gtk/gtkrc.h @@ -38,6 +38,9 @@ extern "C" { /* Forward declaration */ typedef struct _GtkIconFactory GtkIconFactory; +typedef struct _GtkRcStyleClass GtkRcStyleClass; +typedef struct _GtkRCContext GtkRcContext; + #define GTK_TYPE_RC_STYLE (gtk_rc_style_get_type ()) #define GTK_RC_STYLE(object) (G_TYPE_CHECK_INSTANCE_CAST ((object), GTK_TYPE_RC_STYLE, GtkRcStyle)) #define GTK_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_RC_STYLE, GtkRcStyleClass)) @@ -53,8 +56,6 @@ typedef enum GTK_RC_BASE = 1 << 3 } GtkRcFlags; -typedef struct _GtkRcStyleClass GtkRcStyleClass; - struct _GtkRcStyle { GObject parent_instance; @@ -112,14 +113,15 @@ struct _GtkRcStyleClass GtkStyle * (*create_style) (GtkRcStyle *rc_style); }; -void gtk_rc_init (void); +void _gtk_rc_init (void); void gtk_rc_add_default_file (const gchar *filename); void gtk_rc_set_default_files (gchar **filenames); gchar** gtk_rc_get_default_files (void); void gtk_rc_parse (const gchar *filename); void gtk_rc_parse_string (const gchar *rc_string); -gboolean gtk_rc_reparse_all (void); GtkStyle* gtk_rc_get_style (GtkWidget *widget); + +gboolean gtk_rc_reparse_all (void); void gtk_rc_add_widget_name_style (GtkRcStyle *rc_style, const gchar *pattern); void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style, @@ -127,25 +129,14 @@ void gtk_rc_add_widget_class_style (GtkRcStyle *rc_style, void gtk_rc_add_class_style (GtkRcStyle *rc_style, const gchar *pattern); + + GType gtk_rc_style_get_type (void) G_GNUC_CONST; GtkRcStyle* gtk_rc_style_new (void); GtkRcStyle* gtk_rc_style_copy (GtkRcStyle *orig); void gtk_rc_style_ref (GtkRcStyle *rc_style); void gtk_rc_style_unref (GtkRcStyle *rc_style); -/* Tell gtkrc to use a custom routine to load images specified in rc files instead of - * the default xpm-only loader - */ -typedef GdkPixmap* (*GtkImageLoader) (GdkWindow *window, - GdkColormap *colormap, - GdkBitmap **mask, - GdkColor *transparent_color, - const gchar *filename); -void gtk_rc_set_image_loader (GtkImageLoader loader); - -GdkPixmap* gtk_rc_load_image (GdkColormap *colormap, - GdkColor *transparent_color, - const gchar *filename); gchar* gtk_rc_find_pixmap_in_path (GScanner *scanner, const gchar *pixmap_file); gchar* gtk_rc_find_module_in_path (const gchar *module_file); diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c index 87ad7f8d54..63c90ce34f 100644 --- a/gtk/gtkstyle.c +++ b/gtk/gtkstyle.c @@ -1377,6 +1377,21 @@ _gtk_style_peek_property_value (GtkStyle *style, return &pcache->value; } +GdkPixmap * +load_bg_image (GdkColormap *colormap, + GdkColor *bg_color, + const gchar *filename) +{ + if (strcmp (filename, "") == 0) + return (GdkPixmap*) GDK_PARENT_RELATIVE; + else + { + return gdk_pixmap_colormap_create_from_xpm (NULL, colormap, NULL, + bg_color, + filename); + } +} + static void gtk_style_real_realize (GtkStyle *style) { @@ -1421,9 +1436,9 @@ gtk_style_real_realize (GtkStyle *style) for (i = 0; i < 5; i++) { if (style->rc_style && style->rc_style->bg_pixmap_name[i]) - style->bg_pixmap[i] = gtk_rc_load_image (style->colormap, - &style->bg[i], - style->rc_style->bg_pixmap_name[i]); + style->bg_pixmap[i] = load_bg_image (style->colormap, + &style->bg[i], + style->rc_style->bg_pixmap_name[i]); if (!gdk_color_alloc (style->colormap, &style->fg[i])) g_warning ("unable to allocate color: ( %d %d %d )", -- 2.30.2